package com.jxd.project.report.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jxd.project.report.dto.SelectReportDto;
import com.jxd.project.report.model.Report;
import com.jxd.project.report.vo.ReportWithEname;
import com.jxd.project.report.vo.WorkLoadByMonth;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface IReportDao extends BaseMapper<Report> {
    IPage<String> selectLostDate(@Param("empno") int empno, @Param("page") IPage<String> page);

    IPage<Map<String, Object>> selectLostReportByDept(@Param("deptno") int deptno, @Param("page") IPage<Map<String, Object>> page);

    IPage<ReportWithEname> selectAllReport(@Param("selectReportDto")SelectReportDto selectReportDto, @Param("page") IPage<ReportWithEname> page);

    IPage<ReportWithEname> selectCheckReport(@Param("deptno") int deptno, @Param("ename") String ename, @Param("date") String date, @Param("page") IPage<ReportWithEname> page);

    ReportWithEname selectOne(@Param("reportid") int reportid);

    IPage<ReportWithEname> selectReturnReport(@Param("deptno") int deptno, @Param("ename") String ename, @Param("empno") String empno, @Param("page") IPage<ReportWithEname> page);

    boolean insertReport(@Param("report") Report report);

    boolean updateReport(@Param("report") Report report);

    IPage<WorkLoadByMonth> selectWorkLoadByMonth(@Param("deptno") int deptno, @Param("date") String date, @Param("ename") String ename, @Param("page") IPage<WorkLoadByMonth> page);

    IPage<WorkLoadByMonth> selectOvertimeByMonth(@Param("deptno") int deptno, @Param("date") String date, @Param("ename") String ename, @Param("page") IPage<WorkLoadByMonth> page);

    List<Integer> selectIsAbsence(@Param("empno") int empno, @Param("date") String date);
}
